<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ page isELIgnored="false"%>
<head>
<link href="page.css" rel="stylesheet" />
</head>

<script type="text/javascript">
	function gotoPage(pageNo) {
		$("#pageNo").val(pageNo);
		$("#pageForm").submit();
	}

	function deleteOne(id) {
		if (id == "" || id == null) {
			return;
		}
		art.dialog({
			content : '删除后不可恢复,请确认操作',
			// okVal:'确认删除',
			lock : true,
			ok : function() {
				$("#pageForm").attr("action", "../test/testDelete.do");
				$("#pageForm #id").val(id);
				$("#pageForm").submit();
				this.title('1秒后自动关闭').time(1);
				return false;
			},
			cancelVal : '关闭',
			cancel : true
		//为true等价于function(){}

		});
	}
	function view(id) {
		if (id == "" || id == null) {
			return;
		}
		$("#pageForm").attr("action", "../test/testView.do");
		$("#pageForm #id").val(id);
		$("#pageForm").submit();
	}
	function edit(id) {
		if (id == "" || id == null) {
			return;
		}
		$("#pageForm").attr("action", "../test/testEdit.do");
		$("#pageForm #id").val(id);
		$("#pageForm").submit();
	}
	
	function gotoPageChangePageSize(value){
		$("#pageForm #pageSize").val(value);
		$("#pageForm").submit();
	}
</script>
<form id="pageForm" method="post"
	action="${pageContext.request.contextPath}/test/testList.do"
	onsubmit="return navTabSearch(this);">
	<input type="hidden" id="pageSize" name="page.pageSize" value="${page.pageSize}" />
	<input type="hidden" id="pageNo" name="page.pageNo"
		value="${page.pageNo}" /> <input type="hidden" name="orderField"
		value="${orderField}" /> <input type="hidden" name="pageNum"
		value="1" /> <input type="hidden" name="numPerPage"
		value="${page.pageSize}" /> <input type="hidden" name="id" id="id"
		value="${id}" /> <input type="hidden" name="queryStr" id="queryStr"
		value="queryStr" />
</form>

<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<s:iterator value="rights" status="status" id="id">
				<s:if test="#id.equals('deleteAll')">
					<li><a class="delete"
						href="${pageContext.request.contextPath}/test/testDeleteAll.do"
						target="ajaxTodo" title="确定要删除吗?"><span>删除</span> </a></li>
				</s:if>
				<s:if test="#id.equals('add')">
					<li><a class="add"
						href="${pageContext.request.contextPath}/test/testAdd.do"
						target="navTab"><span>添加</span> </a></li>
				</s:if>
			</s:iterator>
		</ul>
	</div>
	<table class="table" width="100%" layoutH="138">
		<thead>
			<tr>
				<th width="43">
					<div class="gridCol" title="">
						<input type="checkbox" group="ids" class="checkboxCtrl">
					</div>
				</th>
				<th width="80">ID</th>
				<th width="120">card</th>
				<th width="120">操作</th>
			</tr>
		</thead>
		<tbody>
			<s:iterator value="page.items" status="item" id="item">
				<tr target="sid_user" rel="1">
					<td style="width: 43px;">
						<div>
							<input name="ids" value="<s:property value="item.id"/>"
								type="checkbox">
						</div>
					</td>
					<td>${id}</td>
					<td>${card}</td>
					<td>
						<div>
							<s:iterator value="rights" status="status" id="id">
								<s:if test="#id.equals('edit')">
									<a title="编辑" href="javascript:edit(${id})" class="btnEdit">编辑</a>
								</s:if>
								<s:if test="#id.equals('delete')">
									<a title="删除" href="javascript:deleteOne(${id})" class="btnDel">删除</a>
								</s:if>
								<s:if test="#id.equals('view')">
									<a title="查看" href="javascript:view(${id})"
										class="btnView">查看</a>
								</s:if>
							</s:iterator>
						</div>
					</td>
				</tr>
			</s:iterator>
		</tbody>
	</table>
	<div class="panelBar">
		<div class="pages2">
			<%-- <div class="pageList">
				<span class="selPage">每页显示 <select name="pageSize1"
					onchange="gotoPage(this.value)">
						<option value="5">5</option>
						<option value="10" selected>10</option>
						<option value="20">20</option>
						<option value="50">50</option>
						<option value="100">100</option>
				</select>条
				</span> <span class="page-total">共196条 当前1/20</span> <a
					href="javascript:gotoPage(1);" class="page-first">首页</a> <span
					class="page-current">1</span> <a title="跳到第2页"
					href="javascript:gotoPage(2);">2</a> <a title="跳到第3页"
					href="javascript:gotoPage(3);">3</a> <a title="跳到第4页"
					href="javascript:gotoPage(4);">4</a> <a title="跳到第5页"
					href="javascript:gotoPage(5);">5</a> <a
					href="javascript:gotoPage(2);" class="page-next">下一页</a> <a
					href="javascript:gotoPage(20);" class="page-last">末页</a> <span
					class="pageOp"> <label for="pageNo">&nbsp;跳至 <select
						name="pageNo1" onchange="gotoPage(this.value)">
							<option value="1" selected="">1</option>
							<option value="2">2</option>
							<option value="3">3</option>
							<option value="4">4</option>
							<option value="5">5</option>
							<option value="6">6</option>
							<option value="7">7</option>
							<option value="8">8</option>
							<option value="9">9</option>
							<option value="10">10</option>
							<option value="11">11</option>
							<option value="12">12</option>
							<option value="13">13</option>
							<option value="14">14</option>
							<option value="15">15</option>
							<option value="16">16</option>
							<option value="17">17</option>
							<option value="18">18</option>
							<option value="19">19</option>
							<option value="20">20</option>
					</select>页
				</label>
				</span>
			</div> --%>
			<jsp:include page="../system/page.jsp" flush="true"></jsp:include>
		</div>
	</div>
</div>
